import { http } from "@/utils/http";

export const missingService = {
	// 根据主单号获取车单
	getCarListByMainOrderNumber: (params) => {
		return http.post("/app-api/tms/logistics/selectByMainOrderNumber", params);
	},
	// 缺件管理列表
	getList: (params) => {
		return http.get("/admin-api/tms/goods-lack/page", params);
	},
	// 根据主单号获取箱号
	getBoxNumber: (mainOrderNumber) => {
		return http.get(
			`/admin-api/tms/goods-lack/listAllBoxNumber?mainOrderNumber=${mainOrderNumber}`,
		);
	},
	// 创建缺件
	create: (params) => {
		return http.post("/admin-api/tms/goods-lack/create", params);
	},
	// 编辑缺件
	update: (params) => {
		return http.post("/admin-api/tms/goods-lack/update", params);
	},
	// 获取缺件详情
	getDetail: (id) => {
		return http.get(`/admin-api/tms/goods-lack/get?id=${id}`);
	},
	// 处理缺件
	process: (params) => {
		return http.put("/admin-api/tms/goods-lack/process", params);
	},
	// 获取航空信息
	getFlightInfo: (id) => {
		return http.get(`/admin-api/tms/flight-info/get?mainOrderNumber=${id}`);
	},
};
